.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.intro-overlay.fade-in {
  opacity: 1;
}

.intro-overlay.fade-out {
  opacity: 0;
}

.intro-dialog {
  background-color: #1e293b;
  color: #f8fafc;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.intro-title {
  font-size: 24px;
  font-weight: bold;
  margin: 0;
  text-align: center;
  color: #38bdf8;
}

.intro-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Name Input Section */
.name-input-section {
  margin-bottom: 12px;
  text-align: center;
}

.name-message {
  margin-bottom: 8px;
  color: #64748b;
  font-size: 14px;
}

.name-input {
  width: 100%;
  max-width: 250px;
  padding: 8px 12px;
  border: 2px solid #3b4759;
  border-radius: 8px;
  font-size: 14px;
  background-color: #1e2635;
  color: #f1f5f9;
  transition: all 0.2s ease;
}

.name-input:hover {
  border-color: #4b5563;
}

.name-input:focus {
  border-color: #38bdf8;
  outline: none;
}

.name-input.invalid {
  border-color: #ef4444;
}

.name-input.invalid:hover,
.name-input.invalid:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px #dc2626;
}

.name-input::placeholder {
  color: #64748b;
}

.name-validation-message {
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
  min-height: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.name-validation-message.visible {
  opacity: 1;
}

/* Authentication Sections */
.email-section, .otp-section {
  background-color: #263247;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.welcome-message {
  font-size: 18px;
  margin-bottom: 12px;
  text-align: center;
  color: #64748b;
}

.consent-message {
  font-size: 11px;
  color: #8f97a2;
  text-align: center;
  margin: 8px auto;
  max-width: 90%;
  line-height: 1.3;
  opacity: 1;
}

.email-input-container, .otp-input-container {
  display: flex;
  width: 100%;
}

.email-input, .otp-input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 6px;
  border: 2px solid #3b4759;
  background-color: #1e2635;
  color: #f1f5f9;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease;
}

.email-input:focus, .otp-input:focus {
  border-color: #38bdf8;
}

.email-input::placeholder, .otp-input::placeholder {
  color: #64748b;
}

.otp-message {
  font-size: 14px;
  margin-bottom: 12px;
  color: #64748b;
  text-align: center;
}

.auth-explanation {
  font-size: 14px;
  margin-bottom: 16px;
  color: #94a3b8;
  text-align: center;
  line-height: 1.5;
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
}

.welcome-verified {
  font-size: 18px;
  color: #38bdf8;
  text-align: center;
  margin: 8px 0 16px;
  animation: fade-in 0.6s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.try-again-btn {
  margin-top: 12px;
  padding: 6px 12px;
  background-color: transparent;
  border: 1px solid #64748b;
  color: #64748b;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.try-again-btn:hover {
  border-color: #38bdf8;
  color: #38bdf8;
}

.error-message {
  color: #ef4444;
  margin-top: 8px;
  font-size: 14px;
  text-align: center;
}

/* Vehicle Toggle */
.vehicle-selection {
  background-color: #263247;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
  transform: scale(0.9);
  margin: -8px 0;
}

.vehicle-selection h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #64748b;
  font-size: 14px;
}

.toggle-container {
  display: flex;
  justify-content: center;
  gap: 16px;
  transform: scale(0.9);
  margin: -4px 0;
}

.toggle-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 20px;
  border-radius: 8px;
  border: 2px solid #3b4759;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-option.selected {
  border-color: #38bdf8;
  background-color: rgba(56, 189, 248, 0.1);
}

.toggle-option:hover:not(.selected) {
  border-color: #4b5563;
}

.vehicle-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

/* Game Instructions */
.game-instructions {
  background-color: #263247;
  padding: 16px;
  border-radius: 8px;
  width: 100%;
}

.instruction-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.instruction-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.2);
}

.key-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 120px;
}

.key-row {
  display: flex;
  gap: 4px;
}

.instruction-key {
  background-color: #384557;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: monospace;
  color: #38bdf8;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.camera-controls .instruction-key {
  font-size: 16px;
  padding: 4px;
  min-width: 30px;
}

/* Start Button */
.start-game-btn {
  padding: 16px 24px;
  background-color: #0ea5e9;
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-top: 16px;
  text-transform: uppercase;
}

.start-game-btn:hover:not(:disabled) {
  background-color: #0284c7;
}

.start-game-btn:disabled {
  background-color: #64748b;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Responsive styles */
@media (max-width: 640px) {
  .intro-dialog {
    padding: 16px;
    max-width: 400px;
  }

  .intro-title {
    font-size: 20px;
  }

  .toggle-container {
    gap: 12px;
    transform: scale(0.85);
  }

  .toggle-option {
    padding: 8px 16px;
  }

  .vehicle-icon {
    font-size: 20px;
  }

  .instruction-item {
    padding: 6px;
    gap: 12px;
  }

  .key-group {
    min-width: 90px;
  }

  .instruction-key {
    padding: 3px 6px;
    font-size: 12px;
  }

  .camera-controls .instruction-key {
    font-size: 14px;
    min-width: 25px;
  }

  .vehicle-selection,
  .game-instructions {
    transform: scale(0.85);
    margin: -10px 0;
  }
}

@media (max-height: 700px) {
  .intro-dialog {
    transform: scale(0.9);
    margin: -16px;
  }

  .game-instructions {
    transform: scale(0.85);
    margin: -12px 0;
  }

  .vehicle-selection {
    transform: scale(0.8);
    margin: -12px 0;
  }
}